﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;

namespace IDE_week2
{
    public partial class Form1 : Form
    {
        bool french = false;
        Form2 SecondForm = new Form2();
        
        public Form1()
        {
            InitializeComponent();
            
            
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            label1.Text = "french";
           
        }

        private void label1_Click(object sender, EventArgs e)
        {


        }

        private void butNewForm_Click(object sender, EventArgs e)
        {
            SecondForm.Show();
        }

        private void butChangeIcon_Click(object sender, EventArgs e)
        {

            this.Icon = Properties.Resources.Icon1;
           
        }

        private void butResetIcon_Click(object sender, EventArgs e)
        {
            Icon = null;
        }


         private void butChangeLan_Click(object sender, EventArgs e)
        {
            if (french == false)
            {
                ChangeLanguage("fr-CM");
                french = true;
            }
            else

            {
                ChangeLanguage("en");
                french = false;
            }
        }

        private void ChangeLanguage (string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }

        private void butCallClass_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = "Press" + numbers[0] + "  " + "to Start,  " + "  " + numbers[1] + "  " + "to Reset  and " + "  " + numbers[2] + "  " + "to Exit";
        }
  
    }
        
                  
  }


